package com_5;

import java.util.TreeSet;

public class StduentDemo {
    public static void main(String[] args) {//
        TreeSet<Student>   t=new TreeSet<>();//
        Student  s1=new Student("李玉",18);//
        Student  s2=new Student("李宇",19);//
        Student  s3=new Student("张三",20);//
        Student  s4=new Student("张二",17);//
        Student  s5=new Student("江",17);//
        Student  s7=new Student("sun",15);//
        t.add(s1);//
        t.add(s2);//
        t.add(s3);//
        t.add(s4);//
        t.add(s5);
        t.add(s7);
        for (Student s6 : t) {//
            System.out.println(s6.getName()+s6.getAge());//
        }
    }
}
